package com.scpii.universal.concurrent.task;

import com.google.protobuf.InvalidProtocolBufferException;
import com.scpii.universal.concurrent.service.LocalCompileService;
import com.scpii.universal.pb.UniversalProtocol.Cmd;
import com.scpii.universal.pb.UniversalProtocol.TaskSC;

public class NativeTask extends Task {

	public NativeTask(TaskMsg msg) {
		super(msg);
	}

	@Override
	public void run() {
		TaskSC task = null;
		switch (Cmd.valueOf(msg.action)) {
		case GetTask:
			try {
				task = TaskSC.parseFrom(msg.data);
			} catch (InvalidProtocolBufferException e) {
				e.printStackTrace();
			}
			LocalCompileService.deal(task, msg);
			break;
		default:
			break;
		}

	}

}
